﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TanmiaGrp.Basis
{
    public class ConfigManager
    {
        public static ConfigManager Obj { get; private set; }
        
        static ConfigManager()
        {
            Obj = new ConfigManager();
        }

        private ConfigManager() { }

        public string DbProvider
        {
            get { return ConfigurationManager.AppSettings["DbProvider"]; }
        }

        public int PageSize
        {
            get
            {
                int retVal = 10;

                string tmp = ConfigurationManager.AppSettings["PageSize"];
                if (!string.IsNullOrEmpty(tmp))
                    retVal = Convert.ToInt32(tmp);

                return retVal;
            }
        }

        public string DateFormat
        {
            get { return CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern; }
        }
    }
}
